//
//  DarkCell.m
//  图你所想
//
//  Created by dllo on 15/9/3.
//  Copyright (c) 2015年 赵璐. All rights reserved.
//

#import "DarkCell.h"

@interface DarkCell ()

@property (nonatomic, assign) CGFloat offWidth;
@property (nonatomic, assign) CGFloat offHeight;

@end

@implementation DarkCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.swith = [[UISwitch alloc]init];
        _swith.backgroundColor = [UIColor clearColor];
        [self.contentView addSubview:_swith];
        
        self.offWidth = [[UIScreen mainScreen]bounds].size.width / 375;
        self.offHeight = [[UIScreen mainScreen]bounds].size.height / 667;
        
        _image = [[UIImageView alloc]init];
        [self.contentView addSubview:_image];
        [_image release];
        
        self.name = [[UILabel alloc]init];
        [self.contentView addSubview:_name];
        [_name release];

        
    }
    return self;
}

- (void)dealloc
{
    [_swith release];
    [super dealloc];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.swith.frame = CGRectMake(self.contentView.frame.size.width - 60, 10, 40, self.contentView.frame.size.height - 20);
    
    _image.frame = CGRectMake(20 * _offWidth, 10 * _offHeight, 30 *_offWidth, 30 * _offHeight);
    _image.layer.cornerRadius = 30 *_offWidth / 2;
    _image.layer.masksToBounds = YES;
    
    _name.frame = CGRectMake(60 *_offWidth, 5 * _offHeight, self.frame.size.width - 60 *_offWidth, self.frame.size.height - 10 * _offHeight);
    
   
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
